
<body>
<div class="am-g tpl-g" style="margin-left: 600px; margin-top: 50px;">
	<div class="tpl-login">
		<div class="tpl-login-content">
			<div class="tpl-login-logo"></div>
			<form class="am-form tpl-form-line-form" method="post">
				<div class="am-form-group">
					<input type="text" class="tpl-form-input username" name="username" placeholder="请输入账号">
				</div>
				<div class="am-form-group">
					<input type="password" class="tpl-form-input password" name="password" placeholder="请输入密码">
				</div>
				<div class="am-form-group tpl-login-remember-me">
					<button><a href="<?php echo site_url() . '/Welcome/sign'; ?>">注册账号</a></button>
				</div>
				<div class="am-form-group">
					<button type="button" class="am-btn am-btn-primary  am-btn-block tpl-btn-bg-color-success  tpl-login-btn">登录</button>
				</div>
			</form>
		</div>
	</div>
</div>
<script src="<?php echo base_url() . 'public/'; ?>assets/js/amazeui.min.js"></script>
<script src="<?php echo base_url() . 'public/'; ?>assets/js/app.js"></script>
<script type="text/javascript">
$(".tpl-login-btn").click(
	function() {
		var data = {};
		data.username = $('.username').val();
		data.password = $('.password').val();
		var url = "<?php echo site_url(); ?>/Welcome/loginAction";
		$.post(url, data, function(json) {
			if (json.status == 0) {
				$(".password").val('');
				layer.msg('账号或密码错误,请重新输入');
			} else {
				layer.msg('登录成功');
				location.href = "<?php echo base_url(); ?>/welcome/index";
			}
		}, 'json');
	}
 );
</script>
</body>
</html>